Skip to content

Comments

Option to do array merges on bcat and badv in stored request processing#4670

Open
postindustria-code wants to merge 2 commits intoprebid:masterfrom
postindustria-tech:stored-request-concat-merge-for-bcat-and-badv
Open

Option to do array merges on bcat and badv in stored request processing#4670
postindustria-code wants to merge 2 commits intoprebid:masterfrom
postindustria-tech:stored-request-concat-merge-for-bcat-and-badv

Conversation

@postindustria-code
Copy link
Contributor

Issue

Addresses Issue #4638

Overview

Added account-level configuration to control how array fields are merged when combining stored requests with incoming requests.

Configuration

New field in account configuration:

account_defaults:
  stored_request: 
    array_merge: "concat"

Modes:

  • replace (default): Arrays are replaced following RFC 7386 JSON Merge Patch semantics
  • concat: Arrays are concatenated for specific fields (bcat, badv)

Behavior

When array_merge: concat is enabled, array fields are concatenated during stored request merging instead of being replaced. Deduplication is not performed.

This applies to:

  • Stored bid request merge
  • Default stored request merge

Edge cases preserved:

  • Empty arrays in incoming request still clear stored request arrays (RFC 7386 semantics)
  • Non-array fields always follow RFC 7386 merge rules
  • Single-sided arrays (only in stored or only in incoming) are preserved as-is

Example:

// stored request
{
    "bcat": ["IAB25", "IAB26"],
    "badv": ["competitor.com"],
    "site": {"name": "StoredApp"}
}

// incoming request:
{
    "bcat": ["IAB8"],
    "badv": ["spam.com"],
    "site": {"name": "MyApp"}
}

// result with array_merge: "replace" (default):
{
    "bcat": ["IAB8"],
    "badv": ["spam.com"],
    "site": {"name": "MyApp"}
}

// result with array_merge: "concat":
{ 
    "bcat": ["IAB25", "IAB26", "IAB8"],
    "badv": ["competitor.com", "spam.com"], 
    "site": {"name": "MyApp"}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant